package com.team.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.team.entity.Patient;
import com.team.service.PatientService;
import com.team.mapper.PatientMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

/**
* @author asus
* @description 针对表【patient(病人表)】的数据库操作Service实现
* @createDate 2024-07-13 14:39:20
*/
@Service
public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient>
    implements PatientService{
@Autowired
private PatientMapper patientMapper;
    @Override
    public int addPatient(Patient patient) {
        Date date=new Date(System.currentTimeMillis());
        patient.setCreatedTime(date);
        return patientMapper.insert(patient);
    }

    @Override
    public Patient getPatientById(String id) {
        return patientMapper.getPatientById(id);
    }

    @Override
    public String hasMedicare(String idCard) {
        return patientMapper.hasMedicare(idCard);
    }

    @Override
    public Integer getPatientId(String idCard) {
        return patientMapper.getPatientId(idCard);
    }

    @Override
    public List<Patient> getPatientBySickroomId(Integer sickroomId) {
        return patientMapper.getPatientBySickroomId(sickroomId);
    }

    @Override
    public int patientOut(Integer id) {
        return patientMapper.patientOut(id);
    }
}




